package 笔试.同行者实习;

public class 找出重复的数 {
    public static void main(String[] args) {

    }

    public static int find(int[] nums) {
        boolean[] cnt = new boolean[1000];
        for (int i = 0; i < nums.length; i++) {
            if (cnt[nums[i]]) {
                return nums[i];
            }
            cnt[nums[i]] = true;
        }
        return -1;
    }
}
